<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>编辑后台管理员</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <script th:src="@{/layui/jquery.min.js}"></script>
    <style type="text/css">
        .layui-input{
            width: 300px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
<form class="layui-form">
    <p style="color: red" id="add-msg"></p>

    <div class="layui-form-item">
        <label class="layui-form-label">管理员ID</label>
        <div class="layui-input-block">
            <input type="text" id="adminId" name="adminId" required  lay-verify="required" th:value="${admin.adminId}"  readonly="readonly" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">管理员名称</label>
        <div class="layui-input-inline">
            <input type="text" id="adminName" name="adminName" required lay-verify="required" th:value="${admin.adminName}" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名</label>
        <div class="layui-input-inline">
            <input type="text" id="realName" name="realName" required lay-verify="required" th:value="${admin.realName}" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>
    <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">角色名称</label>-->
        <!--<div class="layui-input-block">-->
            <!--<input type="hidden" id="roleId" name="roleId" required lay-verify="required" th:if="${admin!=null}" th:value="${admin.roleId}" autocomplete="off" class="layui-input">-->
            <!--<input type="checkbox" id="admin" name="rName" title="管理员">-->
            <!--<input type="checkbox" id="supper-admin" name="rName" title="超级管理员">-->
        <!--</div>-->
    <!--</div>-->


</form>
<script th:src="@{/layui/layui.js}"></script>
<script>
    layui.use('form', function () {
        var form = layui.form;
    });

    //设置获取的值相应的显示
    setShow();
    function  setShow() {
        var roleId=$('#roleId').val();
        var roleIds=parseInt(roleId);
        switch (roleIds) {
            case 5:$('#admin').attr('checked','checked');break;
            case 6:$('#supper-admin').attr('checked','checked');break;
        }
    }


</script>


</body>
</html>